﻿using MVVMPractice.Base;
using MVVMPractice.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace MVVMPractice.ViewModels
{
    public class MainWindowViewModel
    {
        public DataModel dataModel { get; set; }

        public ICommand AddCommand { get; set; }

        public MainWindowViewModel()
        {
            dataModel = new DataModel();
            AddCommand = new Command(AddFunc);
        }

        public void AddFunc(object? obj)
        {
            dataModel.Value3 = dataModel.Value1 + dataModel.Value2;

            WindowProvider.ShowWindow("ChildWindow");
        }
    }
}
